package com.qdlc.p2p.biz.task.flow;

import com.qdlc.p2p.dal.dto.AdditionalFlowProject;
import com.qdlc.p2p.dal.dto.AdditionalFlowRepayPlan;
import com.qdlc.p2p.dal.model.FlowProjectModel;


/**
 * 流转标现在方法工具
 * @author wjx
 * @version 2.0
 * @date 2015年5月28日 下午3:57:22
 */
public class FlowConcurrentUtil {

    /**
     * 购买
     * @param model
     * @param project
     * @throws Exception
     */
    
    public static void tender(AdditionalFlowProject project,FlowProjectModel model)throws Exception{
        FlowValueEvent event = new FlowValueEvent();        
        event.setOperate("flowtender");
        event.setFlowProject(project);
        event.setProjectModel(model);
        event.setResultFlag(model.getResultFlag());
        FlowJobQueue.getTenderInstance().offer(event);
    }
        
 
    /**
     * 还款
     * @param repayPlan
     */
    public static void repay(AdditionalFlowRepayPlan repayPlan){
    	FlowValueEvent event = new FlowValueEvent();        
        event.setOperate("flowrepay");
        event.setFlowRepayPlan(repayPlan);
        FlowJobQueue.getBorrowInstance().offer(event);
    }
}
